/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package InternetHax;
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.Graphics;
/**
 *
 * @author LoginError
 */
public class PixelProcessor {

    public Image process(Image someImage)
    {
        int[] intArray = imageToInt(someImage);
        return intToImage(intArray, someImage.getWidth(),someImage.getHeight());
    }

    private Image intToImage(int[] intArray, int width, int height)
    {
        Image newImage =  Image.createImage(width, height);
        Graphics graphics = newImage.getGraphics();

        graphics.drawRGB(intArray, 0, 0, 0, 0, width, height, true);

        return newImage;
    }

    private int[] imageToInt(Image image)
    {
        int[] intArray = new int[image.getHeight() * image.getWidth()];
        Image.createRGBImage(intArray, image.getWidth(), image.getHeight(), true);
        return intArray;
    }


    int[] blackAndWhite(int[] image)
    {
        throw new RuntimeException("Not implemented");
    }

    int[] invert(int[] image)
    {
        throw new RuntimeException("Not implemented");
    }
   
    int[] hue(int[] image, int hueColor)
    {
        throw new RuntimeException("Not implemented");
    }
    
    
    int[] rotatePalette(int[] image,int[] palette)
    {
        throw new RuntimeException("Not implemented");
    }
    
    int[] greyscale(int[] image)
    {
        throw new RuntimeException("Not implemented");
    }
    
    int[] floodFill(int[] image, int color)
    {
        throw new RuntimeException("Not implemented");
    }
    
    
}
